package com.example.demo.entity.primary;

import javax.persistence.*;

/**
 * Created by dongjunpeng on 2017/10/12.
 */
@Entity
@Table(name = "crane_preset_zone")
public class CranePresetZoneEntity {
    private int cranePresetZoneId;
    private short x1;
    private short x2;
    private short y1;
    private short y2;
    private QuayCraneEntity quayCraneByCraneId;

    @Id
    @Column(name = "crane_preset_zone_id")
    public int getCranePresetZoneId() {
        return cranePresetZoneId;
    }

    public void setCranePresetZoneId(int cranePresetZoneId) {
        this.cranePresetZoneId = cranePresetZoneId;
    }

    @Basic
    @Column(name = "x1")
    public short getX1() {
        return x1;
    }

    public void setX1(short x1) {
        this.x1 = x1;
    }

    @Basic
    @Column(name = "x2")
    public short getX2() {
        return x2;
    }

    public void setX2(short x2) {
        this.x2 = x2;
    }

    @Basic
    @Column(name = "y1")
    public short getY1() {
        return y1;
    }

    public void setY1(short y1) {
        this.y1 = y1;
    }

    @Basic
    @Column(name = "y2")
    public short getY2() {
        return y2;
    }

    public void setY2(short y2) {
        this.y2 = y2;
    }

    @ManyToOne
    @JoinColumn(name = "crane_id", referencedColumnName = "crane_id", nullable = false)
    public QuayCraneEntity getQuayCraneByCraneId() {
        return quayCraneByCraneId;
    }

    public void setQuayCraneByCraneId(QuayCraneEntity quayCraneByCraneId) {
        this.quayCraneByCraneId = quayCraneByCraneId;
    }
}
